#!/usr/bin/env python

# $LastChangedBy$
# $LastChangedRevision$
# $LastChangedDate$
# $HeadURL$

""""
Day.py: An object that contains an entire day
"""

import datetime
import RestingRateModels

class Day:
<<<<<<< .mine
	# Instance variables
	birthday = datetime.date.today()	# Set from Life
	date = datetime.date.today()
	height = 0.0	# cm
	weight = 0.0	# Weight after using restroom but before eating [kg]
	restingHeartRate = 0.0	# Heart rate upon waking up [beats/minute]
	meals = []
	workouts = []
	gender = -1	# Set from Life
=======
   # Instance variables
   birthday = datetime.date.today() # Set from Life
   date = datetime.date.today()
   height = 0.0   # cm
   weight = 0.0   # Weight after using restroom but before eating [kg]
   restingHeartRate = 0.0  # Heart rate upon waking up [beats/minute]
   meals = []
   exercise = []
   gender = -1 # Set from Life
>>>>>>> .r9

   # Getters
   def getDate(self):
      return self.date

   def getHeight(self):
      return self.height

   def getWeight(self):
      return self.weight

   # Source?
   def getBMI(self):
      return ( self.weight / ( self.height / 100.0 )**2.0 )

   def getDaysSinceDate(self, date):
      return ( self.date - date ).days

   def getAgeInDays(self):
      return self.getDaysSinceDate( self.birthday )

   def getAgeInYears(self):
      return self.getAgeInDays() / 365.2425

   # Setters
   def setDate(self, date):
      self.date = date

   def setHeight(self, height):
      self.height = height

   def setWeight(self, weight):
      self.weight = weight

   def setGender(self, gender):
      self.gender = gender

   def setBirthday(self, birthday):
      self.birthday = birthday

   # Meal and exercise functions
   def calculateREE(self, method):
      return RestingRateModels.calculateREE( self.weight, self.height, self.getAgeInYears(), self.gender, method )

   def calculateRestingVdotO2(self, method):
      return RestingRateModels.calculateRestingVdotO2( self.weight, self.height, self.getAgeInYears(), self.gender, method )

   def calculateSpecificRestingVdotO2(self, method):
      return RestingRateModels.calculateSpecificRestingVdotO2( self.weight, self.height, self.getAgeInYears(), self.gender, method )

   # Constructor
   def __init__(self, date, height, weight):
      self.setDate(date)
      self.setHeight(height)
      self.setWeight(weight)
